//---------------------------------------------------------------------
//
//---------------------------------------------------------------------

import java.util.Vector;

class Scope
{
	private Vector<STO> m_lstLocals;
	private boolean returnStmt;

	//----------------------------------------------------------------
	//
	//----------------------------------------------------------------
	public Scope()
	{
		m_lstLocals = new Vector<STO>();
		returnStmt = false;
	}
	
	//----------------------------------------------------------------
	//
	//----------------------------------------------------------------
	public STO access(String strName)
	{
		return accessLocal(strName);
	}

	//----------------------------------------------------------------
	//
	//----------------------------------------------------------------
	public STO accessLocal(String strName)
	{
		STO sto = null;

		for (int i = 0; i < m_lstLocals.size(); i++)
		{
			sto = m_lstLocals.elementAt(i);

			if (sto.getName().equals(strName))
				return sto;
		}

		return null;
	}

	//----------------------------------------------------------------
	//
	//----------------------------------------------------------------
	public void InsertLocal(STO sto)
	{
		m_lstLocals.addElement(sto);
	}

	public boolean hasReturnStmt() {
		return returnStmt;
	}

	public void setReturnStmt(boolean returnStmt) {
		this.returnStmt = returnStmt;
	}
	
	public Vector<STO> getList() {
		return m_lstLocals ;
	}
	
}
